package com.cn.webservices.client;

import java.net.Authenticator;
import java.net.PasswordAuthentication;
import java.net.URL;



/**
 * @ClassName: Test
 * @Description: TODO
 * @author Administrator
 * @date 2017年6月20日
 */

public class Test {
	private  final static  String WS_URL   = "http://localhost:8083/demo-interface/services/test?wsdl" ;

	public static void main(String[] args) throws Exception {
		test();
	}
	
	private static TestService_Service  getImsLookUrlService() throws Exception {
//		Authenticator authenticator = new Authenticator() {
//			protected PasswordAuthentication getPasswordAuthentication() {
//				String superusername = "admin" ;  
//				String superPassword = "123456" ;  
//				return new PasswordAuthentication(superusername, superPassword.toCharArray());
//			}
//		};
//        Authenticator.setDefault(authenticator);
        
        TestService_Service service = new TestService_Service(new URL(WS_URL)) ;
        
		return service ;
	}
	
	public static void  test() throws Exception{
		TestService_Service service=getImsLookUrlService();
		String res=service.getTestServiceImpl().getName(1L);
		System.out.println(res);
	}
}
